package day1104.demo02;

import javax.print.Doc;
import java.util.function.Function;
import java.util.function.Supplier;

/**
 * @program: qy158
 * @description:
 * @author: 闫克起2
 * @create: 2022-11-04 10:09
 **/
public class Test05 {
    public static void main(String[] args) {
//        Function<String,Doctor> function=(t)->new Doctor(t);


        Function<String,Doctor> function=Doctor::new;


//        Supplier<Doctor>  supplier=()->new Doctor();
        Supplier<Doctor>  supplier=Doctor::new;
        System.out.println(supplier.get());

//        Doctor doctor = function.apply("刘德华");
//        System.out.println(doctor);
    }
}
class Doctor{
     private String name;

    public Doctor() {
    }

    public Doctor(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Doctor{" +
                "name='" + name + '\'' +
                '}';
    }
}
